﻿<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/common/taglibs.jsp" %>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>用户管理</title>
		<link href="/resources/src/css/main.css" rel="stylesheet">
   		<link href="/resources/src/css/responsive.css" rel="stylesheet">
		<link href="/resources/src/css/user-manage.css" rel="stylesheet">
		<link href="/resources/src/css/paginate.css" rel="stylesheet">
		<script src="/resources/src/js/jquery-1.9.1.min.js"></script>
	</head>
	<body class="sticky-header left-side-collapsed">
		
		<!-- 移除成员模态框（Modal） -->
		<div class="modal fade" id="delModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content text-center">
					<div class="modal-body">
						<div class="text-tip">是否确认移除该成员移除后该成员将不会接收到任何机构相关消息？</div>
					</div>
					<div class="modal-footer">
					<input type="hidden" id="receiveId" value= ""/>
						<p>
							<button type="button" id="del-cancel" class="btn btn-default cancel" data-dismiss="modal">取消
							</button>
							<button type="button" id="del-confirm" class="btn btn-primary confirm">
								确认
							</button>
						</p>
					</div>
				</div>
			</div>
		</div>
		<!-- /.modal end -->
		
		<!-- 修改资料模态框（Modal） -->
		<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
				<input type="hidden" id="roleUserId" value= ""/>
					<div class="modal-header" style="background-color:#f1f1f1;">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title text-center" id="myModalLabel" style="color:#333;">
							修改资料
						</h4>
					</div>
					<div class="modal-body">
						<div class="clearfix text-left bd-box">
							<div class="tit pull-left"><span>*</span>角色：</div>
							<div class="pull-left select-box">
								<a class="btn-unfold"><span value="2">投资经理</span><i class="pull-right iconfont icon-control-arr-copy-copy"></i></a>
								<div class="options">
									<c:forEach items="${roleList}" var="role">
										<a class="options-item" value="${role.id }">${role.name }<i class="pull-right iconfont icon-gou"></i></a>
									</c:forEach>
								</div>
								
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<p>
							<button type="button" id="edit-cancel" class="btn btn-default cancel" data-dismiss="modal">取消
							</button>
							<button type="button" id="edit-save" class="btn btn-primary confirm">
								保存
							</button>
						</p>
					</div>
				</div>
			</div>
		</div>
		<!-- /.modal end -->
		
		<jsp:include page="../common/left-slide.jsp" flush="true">
	        <jsp:param name="pageHeader" value="userHeader" />
	    </jsp:include>
		<!--body-->
		<div class="main-content">
			<jsp:include page="../common/header-start.jsp" />
        	<div class="main user-manage">
        		<!--左侧边项目导航栏-->
        		<div class="left-aside">
        			<div class="aside-wrapper">
        				<jsp:include page="user-manage-left.jsp" />
        			</div>
        		</div>
        		<!--右侧边正文内容-->
                <div class="right-box text-center">
					<div class="right-header text-left clearfix">
						<div class="pull-left title" style="width:160px;"><span>用户管理</span></div>
						<div class="pull-left date">
							<input type="hidden" id="createTime" value=""/>
							<input type="hidden" id="userId" value="${user.id }"/>
							<input type="hidden" id="endTime" value=""/>
							<input type="text" name="reservation" id="date-picker" class="form-contorl" value=""><i class="icon-date iconfont icon-rili"></i>
						</div>
						<div class="pull-left date">
							<input type="text" class="pull-left" name="condition" placeholder="用户名/电话/邮箱" id="condition" class="form-contorl" value="" style="width:100%;"><i id="searchUser" class="iconfont icon-sousuo-sousuo"></i>
							<a class="btn-block new-progress pull-left btn-active text-center" id="searchUser" href="javascript:void(0)" style="display:none;">&nbsp;搜索</a>
						</div>
						<div class="pull-left">
							<a class="btn-block invitation btn-active pull-right text-center" href="/invitation/send"><i class="iconfont icon-tianjia"></i>&nbsp;邀请成员</a>
						</div>
					</div>
					<div style="padding-left:15px; padding-right:15px;">
						<div class="right-body">
							<div class="person-table table-responsive">
								<table class="table">
									<thead>
										<tr>
											<th>姓名</th>
											<th>角色</th>
											<th>手机号</th>
											<th>邮箱</th>
											<th>加入时间</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody id="mytable">
										<input type="hidden" id="pageNo" value="${page.pageNo }"/>
										<input type="hidden" id="pageSize" value="${page.pageSize }"/>
										<input type="hidden" id="totalCount" value="${page.totalCount }"/>
										<input type="hidden" id="totalPages" value="${page.totalPages }"/>
										<input type="hidden" id="roleId" value="${roleId }"/>
										<c:forEach items="${page.result }" var="page" varStatus="index">
										<tr id="${index.count }">
											<td>${page.user.userName }</td>
											<td class="character" value="0">${page.role.name }</td>
											<td>${page.user.phone }</td>
											<td>${page.user.email }</td>
											<td>${page.user.createTime }</td>
											<td>
												<a class="edit btn-tinge" data-toggle="modal" data-target="#editModal" onclick="update(${page.user.id })">修改资料</a>
												<a class="del btn-tinge" data-toggle="modal" data-target="#delModal" onclick="removeInvest(${page.user.id })">移除</a>
											</td>
										</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<!--分页-->
					<!--pagination start-->
					<div id="pagination"></div>
					<!--pagination end-->
                </div>
           </div>
       </div>
       <!--删除角色模态框-->
		<div class="modal fade" id="del-role-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<input type="hidden" value="" id="del_prpgrass"/>
			<div class="modal-dialog">
				<div class="modal-content text-center">
					<div class="modal-body">
						<div class="text-tip">是否确认删除该角色？</div>
					</div>
					<div class="modal-footer">
						<p>
							<input type="hidden" id="roleIds" value=""/>
							<button type="button" class="btn btn-default cancel" data-dismiss="modal">取消</button>
							<button type="button" class="btn btn-primary confirm" id="deleteRole">确认</button>
						</p>
					</div>
				</div>
			</div>
		</div>

	    <script src="/resources/src/js/jquery.nicescroll.js"></script>
	    <script src="/resources/src/js/main.js"></script>
	    <script src="/resources/src/js/moment.min.js"></script>
	    <script src="/resources/src/js/daterangepicker.js"></script>
	    <script src="/resources/src/js/jquery.paginate.js"></script>
	    <script src="/resources/src/js/bootstrap.min.js"></script>
	    <script src="/resources/src/js/user-manage.js"></script>
	    <script src="/resources/src/js/page.js"></script>
	    
	</body>
</html>
